<template>
  <div class="profile-container">
    <!-- 当不在编辑页面时显示个人资料卡片 -->
    <ProfileCard v-if="!isEditRoute" />
    <!-- 路由出口 -->
    <router-view v-else />
  </div>
</template>

<script setup lang="ts">
import { PageConstant } from '@/common/Constant';
import ProfileCard from '@/components/user/ProfileCard.vue';
import { computed } from 'vue'
import { useRoute } from 'vue-router'

const route = useRoute()
const isEditRoute = computed(() => route.path.includes(PageConstant.ProfileEditPage));
</script>

<style scoped>
.profile-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}
</style>